package com.ice.work.moment.facade.user.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.honeybee.cloud.framework.common.page.Page;
import com.ice.work.moment.facade.user.dto.ResourceDTO;
import com.ice.work.moment.facade.user.model.Resource;
import com.ice.work.moment.facade.user.vo.ResourceVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.Collection;
import java.util.List;

/**
 * @Description ResourceMapper
 * @Author DELL
 * @Create 2019-01-09
 * @Since 1.0.0
 */
@Mapper
@SuppressWarnings("all")
public interface ResourceConvertMapper {
    ResourceConvertMapper INSTANCE = Mappers.getMapper(ResourceConvertMapper.class);

    /**
     * Resource 转 ResourceDTO
     *
     * @param from
     * @return
     */
    ResourceDTO toDTO(Resource from);

    /**
     * List<Resource> Collection<ResourceDTO>
     *
     * @param from
     * @return
     */
    List<ResourceDTO> toDTO(Collection<Resource> from);


    /**
     * ResourceDTO 转 ResourceVO
     *
     * @param from
     * @return
     */
    ResourceVO toVO(ResourceDTO from);

    /**
     * IPage<ResourceDTO> to Page<ResourceVO>
     *
     * @param from
     * @return
     */
    Page<ResourceVO> toVO(Page<ResourceDTO> from);

    /**
     * IPage<Resource> to Page<ResourceDTO>
     *
     * @param from
     * @return
     */
    Page<ResourceDTO> toDTO(IPage<Resource> from);
    /**
     * List<Resource> Collection<ResourceDTO>
     *
     * @param from
     * @return
     */
    List<ResourceVO> toVO(Collection<ResourceDTO> from);

}
